<template>
    <div class="header">
        <div id="nav" v-if="getInfo!=='/login'">        
            <el-menu :default-active="activeIndex" 
                mode="horizontal" 
                background-color="#4d545b" 
                text-color="#ffffff" 
                active-text-color="#fccb4e"
                :router="true">
                <div class="head-logo">
                    <img src="../assets/logo.png" alt="">
                </div>
                <el-menu-item index="/">首页</el-menu-item>
                <el-menu-item index="/info">客服管理</el-menu-item>
                <!-- <el-menu-item index="/member">会员管理</el-menu-item> -->
                <!-- <el-menu-item index="/project">项目管理</el-menu-item> -->
                <el-menu-item index="/state">订单管理</el-menu-item>
                <el-menu-item index="/butler">管家管理</el-menu-item>
                <el-menu-item index="/jifen">商品管理</el-menu-item>
                <el-menu-item index="/login" class="loginout" @click="logout" >退出</el-menu-item>
            </el-menu>
        </div>
        <div class="loginNav" v-show="getInfo=='/login'">
            <h1>后台管理系统<sup> V2019</sup></h1>
        </div>
        <!-- <router-view/> -->
    </div>
</template>

<script>
export default {
    data(){
        return {
            // activeIndex: '/',
        }
    },
    methods:{
        logout(){
            this.$emit('logout')
        }
    },
    computed:{
        getInfo(){
            return this.$route.path;
        },
        activeIndex(){
            return this.$route.path;
        }
    }
}
</script>

<style lang="scss">
#nav .loginout{
    float: right;
}    
.head-logo{
    float: left;
    outline: none;
    padding: 0 20px 0 10px;
    padding-top: 15px;
    img{
        height: 35px;
    }
}
.loginNav{
    margin-top: 10%;
    h1{
        text-align: center;
        font-size: 30px;
        font-weight: bold;
        color:#409EFF;
        text-shadow: 0px 1px 2px rgba(0,57,116,0.3);
        sup{
            font-size: 16px;
        }
    }
}
    
</style>
